class Person {
  private _name: string;
  constructor(name: string) {
    this._name = name
  }

  set name(newName) {
    this._name = newName
  }

  get name() {
    return this._name
  }
}
const p = new Person("yzh")

p.name = "hahahah"   //调用的是 set name 访问器
console.log(p.name);   //调用的是 get name 访问器



export {}